import { MenuItem } from '@/types';

export const menuItems: MenuItem[] = [
  {
    key: 'dashboard',
    label: '仪表盘',
    icon: 'DashboardOutlined',
    path: '/dashboard',
  },
  {
    key: 'user-list',
    label: '用户管理',
    icon: 'UserOutlined',
    path: '/user/list',
  },
  {
    key: 'user-roles',
    label: '角色权限',
    icon: 'SafetyOutlined',
    path: '/user/roles',
  },
  {
    key: 'product-management',
    label: '产品管理',
    icon: 'ShopOutlined',
    children: [
      {
        key: 'product-list',
        label: '产品列表',
        icon: 'AppstoreOutlined',
        path: '/products/list',
      },
      // {
      //   key: 'product-configs',
      //   label: '配置管理',
      //   icon: 'SettingOutlined',
      //   path: '/products/configs',
      // },
      {
        key: 'product-categories',
        label: '类别管理',
        icon: 'TagsOutlined',
        path: '/products/categories',
      },
      {
        key: 'product-brands',
        label: '品牌管理',
        icon: 'CrownOutlined',
        path: '/products/brands',
      },
      {
        key: 'product-statistics',
        label: '统计概览',
        icon: 'BarChartOutlined',
        path: '/products/statistics',
      },
    ],
  },
  {
    key: 'chat-management',
    label: '对话管理',
    icon: 'MessageOutlined',
    children: [
      {
        key: 'ai-chat',
        label: 'AI对话',
        icon: 'RobotOutlined',
        path: '/chat/ai-chat',
      },
      {
        key: 'normal-chat',
        label: '客服对话',
        icon: 'CustomerServiceOutlined',
        path: '/chat/normal-chat',
      },
    ],
  },
  {
    key: 'order-management',
    label: '订单管理',
    icon: 'ShoppingOutlined',
    children: [
      {
        key: 'order-list',
        label: '订单列表',
        icon: 'UnorderedListOutlined',
        path: '/orders/list',
      },
    ],
  },
  {
    key: 'system-config',
    label: '系统配置',
    icon: 'SettingOutlined',
    path: '/system/config',
  },
  {
    key: 'system-logs',
    label: '系统日志',
    icon: 'FileTextOutlined',
    path: '/system/logs',
  },
];

// 根据权限过滤菜单
export const filterMenuByPermissions = (
  menu: MenuItem[],
  permissions: string[]
): MenuItem[] => {
  return menu
    .filter((item) => {
      if (item.permission && !permissions.includes(item.permission)) {
        return false;
      }
      return !item.hidden;
    });
}; 